package main

import (
	"github.com/flaravel/quanlaolao/app/http/middlewares"
	"github.com/flaravel/quanlaolao/bootstrap"
	"github.com/flaravel/quanlaolao/config"
	c "github.com/flaravel/quanlaolao/pkg/config"
	"log"
	"net/http"
)

func init() {
	// 初始化配置信息
	config.Initialize()
}

func main() {
	bootstrap.SetupDB()
	router := bootstrap.SetupRoute()
	log.Printf("http server listener successfully :%d",c.GetInt("app.port"))
	http.ListenAndServe(":"+c.GetString("app.port"), middlewares.RemoveTrailingSlash(router))
}
